package org.jackysoft.report.visitor;

import org.jackysoft.entity.ArmItem;
import org.jackysoft.report.ItemUnit;
import org.jackysoft.report.DataItemType;
import org.jackysoft.report.DataItemUtil;
import org.jackysoft.report.ReportConstant;
import org.springframework.stereotype.Component;

/**
 * 总产值访问者
 */
@Component(ReportConstant.TotalProductionValueVistor)
public class TotalProductionValueVisitor extends AbstractArmItemVisitor {
	private Double total = 0d;
    private DataItemUtil dutil = new DataItemUtil();
	public Double getValue() {
		return this.total;
	}

	public void visite(ItemUnit item) {
		ArmItem itm = (ArmItem) item;
		Double dl = dutil.getDataItemAccumulation(itm,DataItemType.local);
		total += dl * itm.getHost().getPrice();

	}
	
}
